import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.Reader;
import java.nio.Buffer;

// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
    public static void main(String[] args) {
        File f=new File("score");
        Reader r=null;
        try{
           r=new FileReader(f);
        }catch(Exception e){
            e.printStackTrace();
        }

       if(r!=null)
       {
           BufferedReader bf=new BufferedReader(r);
          try {
              String line=bf.readLine();
              //bf.readLine();
              //System.out.println(line);
              while((line=bf.readLine())!=null){
                  String [] strs=line.split("#");
                  int cnt=0;
                  int totalScore=0;
                  for(String str: strs){
                     if(cnt==0){
                         cnt++;
                         continue;
                     }
                     else{
                         totalScore+=Integer.parseInt(str);
                     }
                  }
                  System.out.println(totalScore);
              }
          }catch(Exception e){
              e.printStackTrace();
          }
       }
    }
}